<%@ page isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script type="text/javascript" src="/js/jquery.min.js"></script>
        <script>
            $(function () {
                $("#submitOpr").bind("click",function () {
                    let username = $("#username").val();
                    let password = $("#password").val();
                    $.ajax({
                        url: '/user/login',
                        type: 'POST',
                        data: '{"loginName":"'+  username +'","password":"'+password+'"}',
                        contentType: 'application/json;charset=utf-8',
                        dataType: 'json',
                        success: function (data) {
                            console.info(data);
                            if(data.code == 1){
                                window.location.href = "/resume/main"
                            }else{
                                alert(data.msg);
                            }
                        }
                    })
                })
            })
        </script>
        <style>
            div{
                padding:10px 10px 0 10px;
            }
        </style>
</head>
<body>

<div id="login">
    <div>
        <label>用户名</label>
        <div>
            <input type="text" name="username" id="username"  placeholder="请输入用户名" >
        </div>
    </div>

    <div>
        <label>密码</label>
        <div>
            <input type="password" name="password" id="password" placeholder="请输入密码" >
        </div>
    </div>
    <div >
        <div>
            <button type="submit" id="submitOpr">登录</button>
        </div>
    </div>
</div>

</body>
</html>